import http from '@/design/libs/request/request'

const BASE_URL = '/plugins/invoicing'
export default {
  // 获取列表数据
  list: data => http.post(BASE_URL + '/list', data),
  // 创建数据
  create: data => http.post(BASE_URL + '/create', data),
  // 获取数据
  fetch: (id) => http.post(BASE_URL + '/fetch/' + id),
  // 更新数据
  update: data => http.post(BASE_URL + '/update', data),
  // 删除单个
  delete: (id) => http.post(BASE_URL + '/delete/' + id),
  // 删除集合
  del: data => http.post(BASE_URL + '/delete', data),
  // 更新状态
  disable: data => http.post(BASE_URL + '/disable', data),
  // 重开
  retry: data => http.post(BASE_URL + '/retry', data),
  // 作废
  cancel: data => http.post(BASE_URL + '/cancel', data),
  // 同步
  synchro: data => http.post(BASE_URL + '/synchro', data),
  // 文件下载
  download: (id) => http.download(BASE_URL + '/download/' + id),
  // 订单列表
  orderList: data => http.post(BASE_URL + '/order/list', data),
  // 开票信息
  info: data => http.post(BASE_URL + '/order/info', data),
  // 开具发票
  invoicing: data => http.post(BASE_URL + '/order/invoicing', data),
  // 开具发票
  save: data => http.post(BASE_URL + '/order/save', data),
  // 获取发票抬头列表
  titleList: data => http.post(BASE_URL + '/title/list', data),
  // 获取默认发票抬头
  fetchByDefault: data => http.post(BASE_URL + '/title/default', data),
  // 企业列表查询
  enterpriseList: data => http.post(BASE_URL + '/enterprise/list', data),
  // 企业信息查询
  enterpriseQuery: data => http.post(BASE_URL + '/enterprise/query', data)
}
